package com.webserver.core;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class WebServer {
    private ServerSocket serverSocket;

    public WebServer() {

        try {
            System.out.println("启动服务端...");
            ServerSocket serverSocket = new ServerSocket(8088);
            System.out.println("服务端已启动！");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

    public void start() {

        try {
            System.out.println("等待客户端连接...");
            Socket socket = serverSocket.accept();
            System.out.println("客户端已连接！");


        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        WebServer server = new WebServer();
        server.start();

    }

}
